<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
	<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="<c:url value='/css/style.css'/>" rel="stylesheet" type="text/css"/>
<fmt:setBundle basename="messages" />
<title>Insert title here</title>
</head>
<body>
<%@ include file="Header.jsp"%>
		<table cellspacing="2" cellpadding="1" border="1" align="center" width="100%">
		<tr>
			<td width="300px" style="vertical-align: top"><%@ include file="Menu.jsp"%></td>
			<td>

<h3>Application For Approval</h3>
<c:choose>
<c:when test="${not empty empleaves}">
<table class="borderAll" width="100%">
            <tr>
                <th><fmt:message key="table.lable.leave.reference"/></th>
                <th><fmt:message key="table.lable.leave.empid"/></th>
                <th><fmt:message key="table.lable.leave.empname"/></th>
                <th><fmt:message key="table.lable.leave.leavetype"/></th>
                <th><fmt:message key="table.lable.leave.from"/> </th>
                <th><fmt:message key="table.lable.leave.to"/></th>
                
                <th><fmt:message key="table.lable.leave.viewdetail"/></th>
            </tr>
            <c:forEach var="leave" items="${empleaves}" varStatus="status">
                <tr class="${status.index%2==0?'even':'odd'}">
                    <td class="nowrap">${leave.leaveId}</td>
                    <td class="nowrap">${leave.employeeId}</td>
                    <td class="nowrap">${leave.employeeName}</td>
                    <td class="nowrap">${leave.leaveType}</td>
                    <td class="nowrap">${leave.leaveStartDate}</td>
                    <td class="nowrap">${leave.leaveEndDate}</td>
                    
                    <td class="nowrap">                        
                        <c:url var="viewdetail" scope="page" value="/viewleaveapplication">
                            <c:param name="leaveid" value="${leave.leaveId}"/>
                            <c:param name="mgr" value="true"/>
                        </c:url>
                        <a href="${viewdetail}"><fmt:message key="table.lable.leave.viewdetail"/></a>
                    </td>
                </tr>
            </c:forEach>
        </table>
</c:when>
<c:otherwise>
no record is found
</c:otherwise>  
</c:choose>

</td></tr></table>
</body>
</html>